home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / python2.4 / test / test_future.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2005-10-18  |  4KB  |  127 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.4)
  3.  
  4. import unittest
  5. from test import test_support
  6. import re
  7. rx = re.compile('\\((\\S+).py, line (\\d+)')
  8.  
  9. def get_error_location(msg):
  10.     mo = rx.search(str(msg))
  11.     return mo.group(1, 2)
  12.  
  13.  
  14. class FutureTest(unittest.TestCase):
  15.     
  16.     def test_future1(self):
  17.         test_support.unload('test_future1')
  18.         test_future1 = test_future1
  19.         import test
  20.         self.assertEqual(test_future1.result, 6)
  21.  
  22.     
  23.     def test_future2(self):
  24.         test_support.unload('test_future2')
  25.         test_future2 = test_future2
  26.         import test
  27.         self.assertEqual(test_future2.result, 6)
  28.  
  29.     
  30.     def test_future3(self):
  31.         test_support.unload('test_future3')
  32.         test_future3 = test_future3
  33.         import test
  34.  
  35.     
  36.     def test_badfuture3(self):
  37.         
  38.         try:
  39.             badsyntax_future3 = badsyntax_future3
  40.             import test
  41.         except SyntaxError:
  42.             msg = None
  43.             self.assertEqual(get_error_location(msg), ('badsyntax_future3', '3'))
  44.  
  45.         self.fail("expected exception didn't occur")
  46.  
  47.     
  48.     def test_badfuture4(self):
  49.         
  50.         try:
  51.             badsyntax_future4 = badsyntax_future4
  52.             import test
  53.         except SyntaxError:
  54.             msg = None
  55.             self.assertEqual(get_error_location(msg), ('badsyntax_future4', '3'))
  56.  
  57.         self.fail("expected exception didn't occur")
  58.  
  59.     
  60.     def test_badfuture5(self):
  61.         
  62.         try:
  63.             badsyntax_future5 = badsyntax_future5
  64.             import test
  65.         except SyntaxError:
  66.             msg = None
  67.             self.assertEqual(get_error_location(msg), ('badsyntax_future5', '4'))
  68.  
  69.         self.fail("expected exception didn't occur")
  70.  
  71.     
  72.     def test_badfuture6(self):
  73.         
  74.         try:
  75.             badsyntax_future6 = badsyntax_future6
  76.             import test
  77.         except SyntaxError:
  78.             msg = None
  79.             self.assertEqual(get_error_location(msg), ('badsyntax_future6', '3'))
  80.  
  81.         self.fail("expected exception didn't occur")
  82.  
  83.     
  84.     def test_badfuture7(self):
  85.         
  86.         try:
  87.             badsyntax_future7 = badsyntax_future7
  88.             import test
  89.         except SyntaxError:
  90.             msg = None
  91.             self.assertEqual(get_error_location(msg), ('badsyntax_future7', '3'))
  92.  
  93.         self.fail("expected exception didn't occur")
  94.  
  95.     
  96.     def test_badfuture8(self):
  97.         
  98.         try:
  99.             badsyntax_future8 = badsyntax_future8
  100.             import test
  101.         except SyntaxError:
  102.             msg = None
  103.             self.assertEqual(get_error_location(msg), ('badsyntax_future8', '3'))
  104.  
  105.         self.fail("expected exception didn't occur")
  106.  
  107.     
  108.     def test_badfuture9(self):
  109.         
  110.         try:
  111.             badsyntax_future9 = badsyntax_future9
  112.             import test
  113.         except SyntaxError:
  114.             msg = None
  115.             self.assertEqual(get_error_location(msg), ('badsyntax_future9', '3'))
  116.  
  117.         self.fail("expected exception didn't occur")
  118.  
  119.  
  120.  
  121. def test_main():
  122.     test_support.run_unittest(FutureTest)
  123.  
  124. if __name__ == '__main__':
  125.     test_main()
  126.  
  127.